'''
    Copyright (C) 2007  Brian Will

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.

Use http://code.google.com/p/pigeon-programming-language/issues/list for contacting the author.
'''

BLOCK_STATEMENT_KEYWORDS = [
    '=',
    'break', 
    'continue', 
    'else', 
    'elseif',
    'if', 
    'return', 
    'while'
]

TOP_LEVEL_STATEMENT_KEYWORDS = [
    'function', 
    'modvar',
    'import'       
]

STATEMENT_KEYWORDS = list(set(BLOCK_STATEMENT_KEYWORDS + TOP_LEVEL_STATEMENT_KEYWORDS))

OPERATOR_KEYWORDS = [
    'add', 
    'sub', 
    'mul', 
    'div', 
    'mod', 
    'and', 
    'or', 
    'not', 
    'eq', 
    'lt', 
    'lte', 
    'gt', 
    'gte', 
    'print', # implemented as a function that returns null
    'prompt', 
    'concat', 
    'find', 
    'slice', 
    'count', 
    'id', 
    'neg', 
    'list', 
    'dict'
]

VALUE_LITERALS = [
    'null', 
    'true', 
    'false'
]

PIGEON_KEYWORDS = list(set(STATEMENT_KEYWORDS + OPERATOR_KEYWORDS + VALUE_LITERALS))

PYTHON_RESERVED_WORDS = [
    'as', 
    'assert'
    'break', 
    'class', 
    'continue', 
    'def', 
    'del', 
    'elif', 
    'else', 
    'except', 
    'exec', 
    'finally', 
    'for', 
    'from', 
    'global', 
    'if', 
    'import', 
    'in', 
    'is', 
    'lambda', 
    'not', 
    'or', 
    'pass', 
    'print', 
    'raise', 
    'return', 
    'try', 
    'while', 
    'with', 
    'yield', 
    'None', 
    'True', 
    'False'
]

PIGEON_RESERVED_WORDS = [
    'pigeonOperators'
]

RESERVED_WORDS = list(set(PIGEON_RESERVED_WORDS + STATEMENT_KEYWORDS + OPERATOR_KEYWORDS + VALUE_LITERALS + PYTHON_RESERVED_WORDS))

class TokenTypes(object):
    START_PAREN = 'START_PAREN'
    COMMENT = 'COMMENT'
    END_PAREN = 'END_PAREN'
    ALPHANUMERIC = 'ALPHANUMERIC' 
    IDENTIFIER = 'IDENTIFIER'
    NUMBER_LITERAL = 'NUMBER_LITERAL'
    STRING_LITERAL = 'STRING_LITERAL'
    WHITESPACE = 'WHITESPACE'
    END_LINE = 'END_LINE'
    
    # alphanumeric tokens sorted into these kinds on a later pass
    OPERATOR_KEYWORD = 'OPERATOR_KEYWORD'
    IDENTIFIER = 'IDENTIFIER'
    STATEMENT_KEYWORD = 'STATEMENT_KEYWORD'
    VALUE_LITERAL = 'VALUE_LITERAL'   # null, true, false
